<template>
	<view>
		<view v-for="(item,index) in reserve" :key="index" style="margin: 20rpx;border: 1px solid #DDDDDD;display: flex;flex-direction:row;border-radius: 10rpx;height: 100rpx;">
				<span style="align-items: center;display:flex">
					{{item.meetingName}}
				</span>
				<view style="display: flex;flex-direction: column;margin-left: 50rpx;font-size: 10rpx;color: #c3bfba;">
					<span>
						房间号:{{item.room}}
					</span>
					<span style="margin-top: 30rpx;">
						楼栋号:{{item.building}}
					</span>
				</view>
				<span>
				</span>
				<span v-if="item.status===0" style="align-items: center;display:flex;font-size: 30rpx;color: #000000;margin-left: 300rpx;">
					审核中
				</span>
				<span v-else-if="item.status===1" style="align-items: center;display:flex;font-size: 30rpx;color: #000000;margin-left: 300rpx;color: #01F716;">
					已通过
				</span>
				<span v-else-if="item.status===2" style="align-items: center;display:flex;font-size: 30rpx;color: #000000;margin-left: 300rpx;color: red;">
					未通过
				</span>
				<span v-else style="align-items: center;display:flex;font-size: 30rpx;color: #ff0004;margin-left: 300rpx;">
					已过期
				</span>
		</view>
		<!-- <view style="">
			<view @click="goBack()" style="display: flex;align-items: center;height: 80rpx;border-radius: 10rpx;margin-left: 270rpx;background-color: #40ce50;width: 200rpx;justify-content: center;">返回主页</view>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				reserve:''
			}
		},
		onInit() {
			this.init()
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(){
				uni.request({
					url:"/api/reserve/selectReserveAll?currPage="+1+"&pageSize="+10,
					method:'get',
					header:{
						'Authorization':this.$store.getters.token
					},
					success: (res) => {
						if(res.data.data===null){
							uni.showToast({
											icon: 'error',
											position: 'bottom',
											title: '无预约信息！'+error
										})
						}
						this.reserve=res.data.data
					},
					fail: (error) => {
						uni.showToast({
										icon: 'error',
										position: 'bottom',
										title: '预约失败！'+error
									})
					}
				})
			}
		}
	}
</script>

<style>

</style>
